<template>
	<view class="page pull-record" style="padding-bottom: 0;">
		<!-- 搜索 -->
		<view class="search-box flex-row-between">
			<view class="search flex-row-start">
				<!--  #ifdef  MP-WEIXIN -->
				<image class="icon" src="https://static.newbeaconhotels.com/app/hotel/icon-serach1.png"></image>
				<!--  #endif -->
				<input type="search" :value="initData.param.name" confirm-type="搜索"
				 placeholder="输入活动名称" placeholder-style="color:#b9b9b9;"
				 @input="Oninput" @confirm="Onsearch"/>
				 <!--  #ifdef  H5 -->
				 <image class="icon" src="https://static.newbeaconhotels.com/app/hotel/icon-serach1.png" @click="Onsearch"></image>
				 <!--  #endif -->
			</view>
			<view class="font13">共<text class="font-assist font15">{{dataInfo.count ? dataInfo.count : 0}}</text>人</view>
		</view>
		<view class="hr10"></view>
		<!-- 列表 -->
		<LoadMore ref="LoadMore" id="LoadMore" :token="true" :diffHeight="120" :initData="initData" @dataRefresh='dataRefresh' @infoRefresh='infoRefresh'>
			<view class="record">
				<block v-for="(item, index) in dataList" :key="index">
					<view class="item">
						<view class="title font15 font-theme">渠道：{{item.channel}}</view>
						<view class="flex-row-between">
							<view class="photo bg-cover" :style="{backgroundImage: 'url(' + item.avatar + ')'}"></view>
							<view class="font15 name">{{item.name}}</view>
							<view class="font14 font-666666">注册时间：{{item.add_time}}</view>
						</view>
					</view>
				</block>
			</view>
		</LoadMore>
	</view>
</template>

<script>
	import LoadMore from "@/components/j-loadMore/index.vue";
	export default {
		components: { LoadMore },
		data() {
			return {
				dataList: [],
				dataInfo: {},
				// 传参数据
				initData: {
					url: 'lower',
					param: {
						name:''
					}
				},
			}
		},
		methods: {
			// 搜索输入框
			Oninput(e){
				this.initData.param.name = e.detail.value
			},
			// 点击搜索
			Onsearch(){
				this.$refs.LoadMore.oncutRefresh(this.initData)
			},
			// LoadMore返回列表数据
			dataRefresh(e){
				this.dataList = e
			},
			// LoadMore返回列表信息
			infoRefresh(e){
				this.dataInfo = e
			}
		}
	}
</script>

<style lang="less">
	@import url("style.less");
</style>
